﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

namespace PousadaModelo.Net.MasterPage
{
    public partial class WebForm6 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void btnTeste_Click(object sender, EventArgs e)
        {
            string strProvider = "Data Source = RAFAEL-PC; Initial Catalog = ControleHorasProjeto; Integrated Security=True";
            string strSql = "select * from tb_funcionario";

            SqlConnection con = new SqlConnection(strProvider);
            SqlCommand cmd = new SqlCommand(strSql, con);
            cmd.CommandType = CommandType.Text;


            con.Open();
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataTable dtoCompleto = new DataTable();
            da.Fill(dtoCompleto);

            con.Close();
            dgvTeste.DataSource = dtoCompleto;
            dgvTeste.DataBind();

        }

        protected void Button2_Click(object sender, EventArgs e)
        {

        }
    }
}
